import {createRouter,createWebHistory} from 'vue-router'
//导入组件
import LoginVue from '@/views/Login.vue'
import AdminLayoutVue from '@/views/AdminLayout.vue'
import ProfessionVue from '@/views/Profession.vue'
import TeacherVue from '@/views/Teacher.vue'
import MainClassVue from '@/views/MainClass.vue'
import CourseVue from '@/views/Course.vue'
import StudentVue from '@/views/Student.vue'
import ExamVue from '@/views/Exam.vue'
import BiVue from '@/views/Bi.vue'
import TeacherLayoutVue from '@/views/TeacherLayout.vue'
import MainClassforTeacherVue from '@/views/MainClassforTeacher.vue'
import CourseForTeacherVue from '@/views/CourseForTeacher.vue'
import StudentForTeacherVue from '@/views/StudentForTeacher.vue'
import ExamForTeacherVue from '@/views/ExamForTeacher.vue'
import StudentLayoutVue from '@/views/StudentLayout.vue'
import StuVue from '@/views/stu.vue'
import StucourseVue from '@/views/stucourse.vue'

//定义路由关系
const routes = [
    {path:'/',component:LoginVue},
    {path:'/adminsys',component:AdminLayoutVue,redirect:'/bi',children:[
        {path:'/bi',component:BiVue},
        {path:'/profession',component:ProfessionVue},
        {path:'/teacher',component:TeacherVue},
        {path:'/mainclass',component:MainClassVue},
        {path:'/course',component:CourseVue},
        {path:'/student',component:StudentVue},
        {path:'/exam',component:ExamVue},
    ]},
    {path:'/teachersys',component:TeacherLayoutVue,redirect:'/mainclassforteacher',children:[
        {path:'/mainclassforteacher',component:MainClassforTeacherVue},
        {path:'/courseforteacher', component:CourseForTeacherVue},
        {path:'/studentforteacher',component:StudentForTeacherVue},
        {path:'/examforteacher',component:ExamForTeacherVue}
    ]},
    {path:'/studentsys',component:StudentLayoutVue,redirect:'/stuforstudent',children:[
        {path:'/stuforstudent',component:StuVue},
        {path:'/stucourseforstudent',component:StucourseVue}
    ]},

]

//创建路由器
const router = createRouter({
    history:createWebHistory(),
    routes : routes
})

//导出路由
export default router